package top.v5it.japi.ddd.example.gateway;

import com.fasterxml.jackson.databind.JsonNode;
import org.reactivestreams.Publisher;
import org.springframework.cloud.gateway.filter.factory.rewrite.RewriteFunction;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.web.server.ServerWebExchange;

/**
 * @author zhanpu
 * @date 2023/11/22
 */
public class DecryptRewriteFunctionImpl implements RewriteFunction<String, JsonNode> {

    @Override
    public Publisher<JsonNode> apply(ServerWebExchange serverWebExchange, String resource) {
        final HttpHeaders headers = serverWebExchange.getRequest().getHeaders();
        final MediaType contentType = headers.getContentType();
        if (MediaType.APPLICATION_JSON.equals(contentType)) {

        }
        return null;
    }
}
